home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Merciful 1
/
Merciful - Disc 1.iso
/
software
/
w
/
word_perfect
/
wordperfectv5.0c.dms
/
wordperfectv5.0c.adf
/
pscript.ps
< prev
next >
Wrap
Text File
|
1989-10-31
|
7KB
|
231 lines
% WordPerfect Virtual Printer Interface Program Version 3.0 Amiga
% A PostScript Program to Emulate a Microspace Printer
% (C)Copyright 1986,1988 WordPerfect Corporation - All Rights Reserved
% NOTE - this program can be made to remain persistent in memory on an Apple
% LaserWriter until the power is shut off. To do this remove the '%' from the
% beginning of the line below that starts with the word 'serverdict', add a
% CTRL-D to the end of the file, and enter the LaserWriter password in place of
% the 0 in the line below if the default password has been changed.
% serverdict begin 0 exitserver
/PtrEmDict 80 dict def
/PtrEmulate { PtrEmDict begin printfile end }def
PtrEmDict begin
/tmpstring 1 string def
/getch
{ currentfile read pop
} bind def
/putch
{ dup 36 eq { pop readhex } if % if '\', read hex numbernumber
dup 255 gt { pop 63 } if
tmpstring dup 0 4 -1 roll put show % output char and round
currentpoint exch % to nearest divice pixel
.501 add floor exch moveto % (add .501 instead of .5 toavoid
}bind def % rounding glitch)
/readnum % read any length ASCII number - terminated bynon-digit
{ 0
{ getch dup dup 48 lt exch 57 gt or { pop exit } if
48 sub exch 10 mul add
}loop
}bind def
/readhex % read hex number
{ gethex 16 mul gethex add
}bind def
/gethex % read a number and convert it to $0-$F
{ getch 48 sub dup 10 gt { 7 sub } if
}bind def
/printfile
{ initjob
{ getch % get a char
dup 32 lt % command?
{load exec} % yes, execute it
{putch} % no, output char
ifelse
eod? {exit} if
}loop
}bind def
/initjob
{/eod? false def
/manfeed? false def
/orient 49 def
/res readnum def % device resolution in DPI
/pgwid readnum def % page width in dots
/pglen readnum def % page length in dots
}bind def
/delay % 5 sec delay
{ usertime 5000 add {dup usertime lt {pop exit} if} loop }bind
def
/newcodes [ % foreign char encodings
16#80 /Agrave 16#81 /Aacute 16#82 /Acircumflex
16#83 /Atilde 16#84 /Adieresis 16#85 /Aring
16#86 /Ccedilla 16#87 /Egrave 16#88 /Eacute
16#89 /Ecircumflex 16#8A /Edieresis 16#8B /Igrave
16#8C /Iacute 16#8D /Icircumflex 16#8E /Idieresis
16#90 /Ntilde 16#91 /Ograve 16#92 /Oacute
16#93 /Ocircumflex 16#94 /Otilde 16#95 /Odieresis
16#96 /Ugrave 16#97 /Uacute 16#98 /Ucircumflex
16#99 /Udieresis 16#9A /Yacute 16#9C /agrave
16#9D /aacute 16#9E /acircumflex 16#9F /atilde
16#A0 /adieresis 16#A6 /aring 16#8F /ccedilla
16#AC /egrave 16#AD /eacute 16#AE /ecircumflex
16#AF /edieresis 16#B0 /igrave 16#B1 /iacute
16#B2 /icircumflex 16#B3 /idieresis 16#B9 /oacute
16#BA /ograve 16#BC /oacute 16#BD /ocircumflex
16#AA /otilde 16#CD /odieresis 16#CE /ugrave
16#D0 /uacute 16#E8 /ucircumflex 16#EA /udieresis
16#F8 /yacute 16#FA /ydieresis
] def
/reencdict 12 dict def
/ReEncode % reencodes a font
{reencdict begin
/newname exch def /basename exch def
/basedict basename findfont def
/newfont basedict maxlength dict def
basedict
{ exch dup /FID ne
{ dup /Encoding eq
{ exch dup length array copy newfont 3 1 roll put }
{ exch newfont 3 1 roll put } ifelse
}{ pop pop }ifelse
} forall
newfont /FontName newname put
newcodes aload pop newcodes length 2 idiv
{ newfont /Encoding get 3 1 roll put } repeat
newname newfont definefont pop
end % of reencdict
}bind def
0 %NULLs are ignored
{}bind def
1 %SOP
{pglen 4200 eq {legal} if
72 res div dup scale % scale to new dpi (must doeach page)
orient 50 eq
{ pgwid 0 translate 90 rotate % landscape
pglen pgwid /pglen exch def
/pgwid exch def
} if
orient 51 eq
{ pgwid pglen translate
180 rotate % reverse portrait
} if
orient 52 eq
{ 0 pglen translate 270 rotate % reverse landscape
pglen pgwid /pglen exch def
/pgwid exch def
} if
0 pglen moveto % move to top left of page
}bind def
2 %EOD
{ /eod? true def }bind def
5 %MS
{ readnum 0 rmoveto }bind def
6 %RMS
{ readnum neg 0 rmoveto }bind def
7 %CR
{ 0 currentpoint exch pop moveto }bind def
8 %manual feed this page
{ /manfeed? true def }bind def
9 %VMI
{ /vmi readnum def }bind def
10 %LF
{ currentpoint vmi sub moveto }bind def
11 %RLF
{ currentpoint vmi add moveto }bind def
12 %EOP
{ manfeed?
{ delay statusdict /manualfeed true put delay
showpage statusdict /manualfeed false put
/manfeed? false def
}{ showpage }ifelse
}bind def
14 %set number of copies
{ /#copies readnum store }bind def
15 %set new orientation 1=PORT 2=LAND 3=RevPORT 4=RevLAND
{ /orient getch def }bind def
16 %change fonts
{ getch load exec % get font id and do its proc
dup FontDirectory exch known % is reencoded nameknown?
{ exch pop } % yes, get rid of long name
{ dup 3 1 roll ReEncode } ifelse % no, reencode it
findfont
readnum dup /fsize exch def
scalefont setfont
}bind def
18 %shift to symbol font for one char only
{ currentfont
/Symbol findfont fsize scalefont setfont
getch putch setfont
}bind def
21 %start of auto underlining
{ /ulfont currentfont def
/ulstart currentpoint pop def
}bind def
22 %end of auto underlining
{ currentfont ulfont setfont
currentpoint ulstart exch moveto ulstart sub cvi % width tounderline
/ulsize tmpstring dup 0 95 put
stringwidth pop .501 add floor cvi def
dup ulsize idiv { 95 putch } repeat
cvi ulsize mod dup 0 ne { ulsize sub 0 rmoveto 95 putch } { pop } ifelse
setfont
}bind def
23 %select paper tray
{ statusdict begin
readnum
setpapertray %0,1,or 2 selects upper, lower, or limitless
end
}bind def
% FONTS
65 {/Helvetica /helv }def %A
66 {/Helvetica-Oblique /helvo }def %B
67 {/Helvetica-Bold /helvb }def %C
68 {/Helvetica-BoldOblique /helvbo }def %D
69 {/Times-Roman /tims }def %E
70 {/Times-Italic /timsi }def %F
71 {/Times-Bold /timsb }def %G
72 {/Times-BoldItalic /timsbi }def %H
73 {/AvantGarde-Book /avgb }def %I
74 {/AvantGarde-BookOblique /avgbo }def %J
75 {/AvantGarde-Demi /avgd }def %K
76 {/AvantGarde-DemiOblique /avgdo }def %L
77 {/Bookman-Demi /bookd }def %M
78 {/Bookman-DemiItalic /bookdi }def %N
79 {/Bookman-Light /bookl }def %O
80 {/Bookman-LightItalic /bookli }def %P
81 {/Helvetica-Narrow /hlvn }def %Q
82 {/Helvetica-Narrow-Oblique /hlvno }def %R
83 {/Helvetica-Narrow-Bold /hlvnb }def %S
84 {/Helvetica-Narrow-BoldOblique /hnbo }def %T
85 {/NewCenturySchlbk-Roman /ncsr }def %U
86 {/NewCenturySchlbk-Italic /ncsi }def %V
87 {/NewCenturySchlbk-Bold /ncsb }def %W
88 {/NewCenturySchlbk-BoldItalic /ncsbi }def %X
89 {/Palatino-Roman /palr }def %Y
90 {/Palatino-Italic /pali }def %Z
97 {/Palatino-Bold /palb }def %a
98 {/Palatino-BoldItalic /palbi }def %b
99 {/ZapfChancery-MediumItalic /zchmi }def %c
117 {/Courier /cr }def %u
118 {/Courier-Oblique /cro }def %v
119 {/Courier-Bold /crb }def %w
120 {/Courier-BoldOblique /crbo }def %x
121 {/Symbol /Symbol }def %y
122 {/ZapfDingbats /ZapfDingbats }def %z
end % of PtrEmDict